package org.ishequ.service;

import java.util.ArrayList;
import java.util.List;
import net.sf.json.JSONArray;
import org.ishequ.domain.News;

public class NewsService {
	
	public List<News> getLastNews(){
		List<News> news = new ArrayList<News>();
		
		News n1 = new News();
		n1.setId(1);
		n1.setName("视频一");
		n1.setTimelen(90);
		news.add(n1);
		
		News n2 = new News();
		n2.setId(2);
		n2.setName("视频二");
		n2.setTimelen(5);
		news.add(n2);
		
		News n3 = new News();
		n3.setId(3);
		n3.setName("视频三");
		n3.setTimelen(65);
		news.add(n3);
		
		return news;
	}
	
	public String getJSONNews(){
		JSONArray jsonArray = JSONArray.fromObject(getLastNews());
		return jsonArray.toString();
	}

}
